﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.WebAPI.Application.Command.StartCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.StartCommandHandler
{

    /// <summary>
    /// 期初删除CommandHandler
    /// </summary>
    public class StartDeleteCommandHandler : IRequestHandler<StartDeleteCommand, Results<int>>
    {
        private readonly IStartService _startService;
        public StartDeleteCommandHandler(IStartService startService)
        {
            _startService = startService;
        }



        public async Task<Results<int>> Handle(StartDeleteCommand request, CancellationToken cancellationToken)
        {
            var list= await _startService.DeleteStart(request.StartId);
            return Results<int>.DataResult(list);
        }
    }
}
